package org.nepu.scr.indexrate.converter.compliancerate.differencerate;

import cn.hutool.json.JSONUtil;
import org.nepu.scr.indexrate.vo.compliancerate.differencerate.PressureTest1_2;

import javax.persistence.AttributeConverter;
import javax.persistence.Convert;

@Convert
public class PressureTestConverter1_2 implements AttributeConverter<PressureTest1_2, String> {
    @Override
    public String convertToDatabaseColumn(PressureTest1_2 pressureTest) {
        return JSONUtil.toJsonStr(pressureTest);
    }

    @Override
    public PressureTest1_2 convertToEntityAttribute(String s) {
        return JSONUtil.toBean(s, PressureTest1_2.class);
    }
}
